package com.yonyou.pmclouds.constructiondiary.mapper;

import com.yonyou.pmclouds.basecom.dao.BaseMapper;
import com.yonyou.pmclouds.constructiondiary.entity.ConstructionDiaryVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

public interface ConstructionDiaryMapper extends BaseMapper<ConstructionDiaryVO> {
    @Select("select creator, creationtime, pk_constructiondiary,billstatus from pm_constructiondiary where pk_project = #{pkProject} and dr = 0  order by creationtime desc")
    @ResultMap("getMap")
    ConstructionDiaryVO[] getDiaryListInfo(String pkProject);
    @Select("select * from pm_constructiondiary where pk_constructiondiary = #{pkConstructiondiary} and dr = 0 ")
    @ResultMap("getMap")
    ConstructionDiaryVO getByID(String pkConstructiondiary);
    Integer selectRefByCode(@Param("code")String code, @Param("ids") String[] ids);

    ConstructionDiaryVO[] queryByCondition(@Param("pkProjects")String[] pkProjects,
                                         @Param("creators") String[] creators,
                                         @Param("startDate") String startDate,
                                         @Param("endDate") String endDate,
                                         @Param("billStatus") int[] billStatus,
                                         @Param("start") int start,
                                         @Param("size") int size);
    int countByCondition(@Param("pkProjects")String[] pkProjects,
                         @Param("creators") String[] creators,
                         @Param("startDate") String startDate,
                         @Param("endDate") String endDate,
                         @Param("billStatus") int[] billStatus);

//    @Select("select pk_constructiondiary from pm_constructiondiary where pk_project = #{pkProject} and dr = 0  order by creationtime desc")
//    @ResultType(String.class)
//    String[] getIdsByPrj(String pkProject);
}
